home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_6.lha / 7_6 / 7_6f.h < prev    next >
Text File  |  1993-08-08  |  805b  |  38 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / manage a doubly-linked list
  6. lass dlist
  7.  
  8.    dlink *last;
  9.    dlink *curr;
  10.  
  11. ublic:
  12.    dlist();
  13.    dlist(ent e);
  14.    ~dlist();
  15.    int isempty() { return last != 0; }
  16.    void clear();
  17.  
  18.    // set current pointer to the ends of the list
  19.    void reset() { curr = 0; }
  20.  
  21.    // move around the list, leaving the links there
  22.    int next(ent &e);
  23.    int prev(ent &e);
  24.  
  25.    // move around the list, removing the links
  26.    int getnext(ent &e);
  27.    int getprev(ent &e);
  28.  
  29.    // manipulate around the beginning
  30.    // and end of the list
  31.    void insert(ent e);
  32.    void append(ent e);
  33.  
  34.    // manipulate around the current entry
  35.    void inserthere(ent e);
  36.    void appendhere(ent e);
  37. ;
  38.